<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
Route::get('/', 'Home\IndexController@index');

//注册页
Route::get('/home/reg','Home\RegController@reg');
//验证邮箱是否重复
Route::get('/home/reg/testemail','Home\RegController@testEmail');
//发送邮件验证码
Route::get('/home/reg/sendemail','Home\RegController@sendEmail');
//注册
Route::post('/home/reg/doreg','Home\RegController@doreg');
//登录
Route::post('/home/login/dologin','Home\LoginController@doLogin');
//注销
Route::get('/home/login/cancel','Home\LoginController@cancel');
//个人中心
Route::get('/home/user/personal','Home\UserController@personal');
//修改信息
Route::post('/home/user/update','Home\UserController@update');
//修改头像
Route::get('/home/user/photo','Home\UserController@photo');
//上传头像
Route::post('/home/user/dophoto','Home\UserController@dophoto');
//用户修改密码
Route::get('/home/user/upwd','Home\UserController@upwd');
Route::post('/home/user/newpwd','Home\UserController@newpwd');
//找回密码
Route::get('/home/user/forget', 'Home\UserController@forget');
Route::post('/home/user/forgetemail', 'Home\UserController@forgetemail');
Route::get('/home/user/newpass/id/{id}/token/{token}', 'Home\UserController@newpass');
//改密码
Route::post('/home/user/renew', 'Home\UserController@renew');

//发现模块
Route::get('/home/movie', 'Home\MovieController@index');

//电影详情
Route::get('home/movie/details/{id}', 'Home\MovieController@details');


//电影详情子页
// 视频
// Route::get('home/movie/details/{id}/trailer', 'Home\MovieController@trailer');
// 图片
Route::get('home/movie/details/{id}/image', 'Home\MovieController@image');
// 剧情
Route::get('home/movie/details/{id}/plots', 'Home\MovieController@plots');
// 其他资料
Route::get('home/movie/details/{id}/other', 'Home\MovieController@other');
// 演职员
Route::get('home/movie/details/{id}/actor', 'Home\MovieController@actor');
// 影评
Route::get('home/movie/details/{id}/comment', 'Home\MovieController@comment');
// 前台图片上传
Route::post('/home/upload/insert', 'Home\UploadController@insert');
// 前台电影评论
Route::post('/home/comment/comment', 'Home\CommentController@comment');
// 前台电影评论的评论
Route::post('/home/comment/reply', 'Home\CommentController@reply');
//前台电影评论点赞
Route::get('/home/comment/couns', 'Home\CommentController@couns');



//这是后台
//登录页
Route::get('/admin/login','Admin\LoginController@login');
//注销
Route::get('/admin/cancel','Admin\LoginController@cancel');

//验证码
Route::get('/kit/captcha/{tmp}', 'Admin\KitController@captcha');

Route::post('/admin/dologin','Admin\LoginController@doLogin');



// 后台登录中间件
Route::group(['middleware' => 'adminLogin'], function()
	{



		//后台首页
		Route::get('/admin/index/index', 'Admin\IndexController@index');

		Route::get('/admin/index/ajaxmore', 'Admin\IndexController@ajaxmore');

		Route::get('/admin/index/ajaxpost', 'Admin\IndexController@ajaxpost');

		Route::get('/admin/index/ajaxtypes', 'Admin\IndexController@ajaxtypes');

		//用户管理模块
		Route::get('/admin/user/add', 'Admin\UserController@add');

		Route::post('/admin/user/insert', 'Admin\UserController@insert');

		Route::get('/admin/user/index', 'Admin\UserController@index');

		Route::get('/admin/user/edit/{id}', 'Admin\UserController@edit');

		Route::post('/admin/user/update', 'Admin\UserController@update');

		Route::get('/admin/user/delete/{id}', 'Admin\UserController@delete');

		Route::post('/admin/user/ajaxUpdate', 'Admin\UserController@ajaxUpdate');

		Route::post('/admin/user/ajaxEmail', 'Admin\UserController@ajaxEmail');

		//分类管理
		Route::get('/admin/cate/add', 'Admin\CateController@add');
		Route::post('/admin/cate/insert', 'Admin\CateController@insert');
		Route::get('/admin/cate/index', 'Admin\CateController@index');
		Route::get('/admin/cate/edit/{id}', 'Admin\CateController@edit');
		Route::post('/admin/cate/update', 'Admin\CateController@update');
		Route::get('/admin/cate/delete/{id}', 'Admin\CateController@delete');
		Route::post('/admin/cate/ajaxUpdate', 'Admin\CateController@ajaxUpdate');
		Route::get('/admin/cate/post/{id}', 'Admin\CateController@post');
		Route::post('/admin/cate/postPublish', 'Admin\CateController@postPublish');

		//影评管理
		Route::get('/admin/post/index/{id?}', 'Admin\Postcontroller@index');
		Route::post('/admin/post/ajaxUpdate', 'Admin\Postcontroller@ajaxUpdate');
		Route::get('/admin/post/recycle', 'Admin\Postcontroller@recycle');
		Route::get('/admin/post/delete/{id}', 'Admin\Postcontroller@delete');



	});